import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'

const whiteUrl=['/pages/Login/Login'];
uni.addInterceptor("navigateTo",{
	invoke({url}){
		
		if(whiteUrl.includes(url.split('?')[0])){
			return true
		}

		const token = uni.getStorageSync("token")
		// const token = "liuzhixuan"
		if(!token){
			uni.navigateTo({
				url:"/pages/Login/Login"
			})
			return false
		} 
		return true
		// uni.redirectTo({
		// 	url:"/pages/index/index"
		// })
	}
})


const app = new Vue({
  ...App
})
import common from '@/utils/UpdateFile.js' 
Vue.prototype.$common = common

import message from '@/utils/message.js' 
Vue.prototype.$message = message

app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif